package com.moxiao.yfjh.module.maker.dal.mysql.matchMakerStringing;

import com.moxiao.yfjh.module.maker.controller.admin.matchMakerStringing.vo.MatchmakerStringingExportReqVO;
import com.moxiao.yfjh.module.maker.controller.admin.matchMakerStringing.vo.MatchmakerStringingPageReqVO;
import com.moxiao.yfjh.module.maker.dal.dataobject.matchMakerStringing.MatchmakerStringingDO;
import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.maker.controller.admin.matchMakerStringing.vo.*;

/**
 * 相亲红娘牵线记录 Mapper
 *
 * @author mx
 */
@Mapper
public interface MatchmakerStringingMapper extends BaseMapperX<MatchmakerStringingDO> {

    default PageResult<MatchmakerStringingDO> selectPage(MatchmakerStringingPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MatchmakerStringingDO>()
                .eqIfPresent(MatchmakerStringingDO::getNo, reqVO.getNo())
                .eqIfPresent(MatchmakerStringingDO::getMatchmakerId, reqVO.getMatchmakerId())
                .likeIfPresent(MatchmakerStringingDO::getMatchmakerName, reqVO.getMatchmakerName())
                .eqIfPresent(MatchmakerStringingDO::getMatchmakerPhone, reqVO.getMatchmakerPhone())
                .eqIfPresent(MatchmakerStringingDO::getManId, reqVO.getManId())
                .eqIfPresent(MatchmakerStringingDO::getWomanId, reqVO.getWomanId())
                .eqIfPresent(MatchmakerStringingDO::getActiveId, reqVO.getActiveId())
                .betweenIfPresent(MatchmakerStringingDO::getCreateTime, reqVO.getCreateTime())
//                .notLike(MatchmakerStringingDO::getStringingStatus, (byte) 2)
                .eqIfPresent(MatchmakerStringingDO::getStringingStatus, reqVO.getStringingStatus())
                .orderByDesc(MatchmakerStringingDO::getId));

    }

    default List<MatchmakerStringingDO> selectList(MatchmakerStringingExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<MatchmakerStringingDO>()
                .eqIfPresent(MatchmakerStringingDO::getNo, reqVO.getNo())
                .eqIfPresent(MatchmakerStringingDO::getMatchmakerId, reqVO.getMatchmakerId())
                .likeIfPresent(MatchmakerStringingDO::getMatchmakerName, reqVO.getMatchmakerName())
                .eqIfPresent(MatchmakerStringingDO::getMatchmakerPhone, reqVO.getMatchmakerPhone())
                .eqIfPresent(MatchmakerStringingDO::getManId, reqVO.getManId())
                .eqIfPresent(MatchmakerStringingDO::getWomanId, reqVO.getWomanId())
                .eqIfPresent(MatchmakerStringingDO::getActiveId, reqVO.getActiveId())
                .eqIfPresent(MatchmakerStringingDO::getStringingStatus, reqVO.getStringingStatus())
                .betweenIfPresent(MatchmakerStringingDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MatchmakerStringingDO::getId));
    }

}
